<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查找兄弟元素</title>
    <style>
        .mycolor{
            color:#fff;
            background-color:#F8DD88;
        }
        .steam{
            color:red;
        }
    </style>
</head>
<body>
<ul id="ul">
    <li id="ali">油条</li>
    <li id="bli">包子</li>
    <li id="cli">米饺</li>
</ul>
<script>
    //查找父节点
    var tempel=document.getElementById('bli');
    tempel.className="steam";

    var previousNode=tempel.previousSibling;
    previousNode.className="mycolor";

    var nextNode=tempel.nextSibling;
    nextNode.className="mycolor";
</script>
</body>
</html>